<html>
<script type="text/javascript">
var str="abcdefgh";
console.log(str.substring(0,1));//a
console.log(str.substring(2,5));//cde 
console.log(str.substring(7,8));//h
console.log(str.substr(0,3));//abc
console.log(str.substr(3,4));//defg
</script>
</html>









